<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="kr.co.icebird.spring3.app.model.Member" %>
<%@ page import="org.jfree.chart.ChartFactory" %>
<%@ page import="org.jfree.chart.ChartUtilities" %>
<%@ page import="org.jfree.chart.JFreeChart" %>
<%@ page import="org.jfree.data.general.DefaultPieDataset" %>

<%
	DefaultPieDataset chartDataset = new DefaultPieDataset();
	List list = (List)request.getAttribute("mList");
	
	for(int i=0; i<list.size(); i++){
		
		Member m = (Member)list.get(i);
		
		out.println(m.getName());
		chartDataset.setValue(m.getName(), m.getAge());	
	}
	JFreeChart chart = ChartFactory.createPieChart(
			"Mobile Device Pie Chart", chartDataset, true, true, true);
	
	//ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, 400, 400);
//for (Member  member : memberService.getMemberList()) {
//	chartDataset.setValue(member.getName(), member.getAge());	
//}


%>